Ensure the Affected column in Issues#index is updated when an affected node is renamed or merged#1273
Open
Ensure the Affected column in Issues#index is updated when an affected node is renamed or merged#1273
Affected column in Issues#index is updated when an affected node is renamed or merged#1273Conversation
Affected column in Issues#index is updated when an affected node is renamed or merged
aapomm
reviewed
Jun 27, 2024
| @@ -1,4 +1,4 @@ | |||
| <% cache ['issues-table', @all_columns, issues.map(&:id), @issues.map(&:updated_at).map(&:to_i).sort.last, @tags] do %> | |||
| <% cache ['issues-table', @all_columns, issues.map(&:affected), issues.map(&:id), @issues.map(&:updated_at).map(&:to_i).sort.last, @tags] do %> | |||
Contributor
There was a problem hiding this comment.
Do we need this change? If only 1 node is updated, then the whole table's cache busts. Maybe we can go with just the per-issue caching change
Contributor
Author
There was a problem hiding this comment.
Without this change, the table doesn't show the correct affected column because the cache isn't busted. Do we need to cache the table if we are caching each row?
Contributor
There was a problem hiding this comment.
Ah looks like I'm mistaken and the inner fragment caching are preserved and not busted: https://guides.rubyonrails.org/caching_with_rails.html#russian-doll-caching
Member
There was a problem hiding this comment.
@aapomm why is the outer cache key change needed then? Affected is always defined as a column.
aapomm
reviewed
Jun 27, 2024
instead we are just keeping the updated_at value which will be enough to bust the cache Co-authored-by: Aaron Manaloto <mail@aapomm.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes a bug where the issues table would not show an accurate list of affected nodes after an affected node has been renamed or merged.
Check List